#include <iostream>
#include <string>
using namespace std;

string check(string a) {
    while (a.find("()")!= -1 or a.find("[]")!= -1 or a.find("{}") != -1){
        if (a.find("()") != -1){
            a.replace(a.find("()"), 2, "");
        }
        if (a.find("[]") != -1){
            a.replace(a.find("[]"), 2, "");
        }
        if (a.find("{}") != -1){
          a.replace(a.find("{}"), 2, "");
        }
    }
    return a;
}

int main() {
    string a;            
    cout << "Введите a";
    cin >> a;
    a = check(a);
    cout << a << endl;
    if (a.length() > 0) {
        cout << "False" << endl;
    } else {
        cout << "True" << endl;
    }
    return 0;
}
